Integrand size = 23, antiderivative size = 54 \[ \int \frac {\csc ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{(a+b)^{3/2} f}-\frac {\cot (e+f x)}{(a+b) f} \]
Result contains complex when optimal does not.
Time = 0.89 (sec) , antiderivative size = 189, normalized size of antiderivative = 3.50 \[ \int \frac {\csc ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {(a+2 b+a \cos (2 (e+f x))) \sec ^2(e+f x) \left (b \arctan \left (\frac {\sec (f x) (\cos (2 e)-i \sin (2 e)) (-((a+2 b) \sin (f x))+a \sin (2 e+f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right ) (\cos (2 e)-i \sin (2 e))+\sqrt {a+b} \csc (e) \csc (e+f x) \sqrt {b (\cos (e)-i \sin (e))^4} \sin (f x)\right )}{2 (a+b)^{3/2} f \left (a+b \sec ^2(e+f x)\right ) \sqrt {b (\cos (e)-i \sin (e))^4}} \]
((a + 2*b + a*Cos[2*(e + f*x)])*Sec[e + f*x]^2*(b*ArcTan[(Sec[f*x]*(Cos[2* e] - I*Sin[2*e])*(-((a + 2*b)*Sin[f*x]) + a*Sin[2*e + f*x]))/(2*Sqrt[a + b ]*Sqrt[b*(Cos[e] - I*Sin[e])^4])]*(Cos[2*e] - I*Sin[2*e]) + Sqrt[a + b]*Cs c[e]*Csc[e + f*x]*Sqrt[b*(Cos[e] - I*Sin[e])^4]*Sin[f*x]))/(2*(a + b)^(3/2 )*f*(a + b*Sec[e + f*x]^2)*Sqrt[b*(Cos[e] - I*Sin[e])^4])
Time = 0.23 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.96, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3042, 4620, 264, 218}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\csc ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sin (e+f x)^2 \left (a+b \sec (e+f x)^2\right )}dx\) |
\(\Big \downarrow \) 4620 |
\(\displaystyle \frac {\int \frac {\cot ^2(e+f x)}{b \tan ^2(e+f x)+a+b}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 264 |
\(\displaystyle \frac {-\frac {b \int \frac {1}{b \tan ^2(e+f x)+a+b}d\tan (e+f x)}{a+b}-\frac {\cot (e+f x)}{a+b}}{f}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{(a+b)^{3/2}}-\frac {\cot (e+f x)}{a+b}}{f}\) |
(-((Sqrt[b]*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a + b]])/(a + b)^(3/2)) - C ot[e + f*x]/(a + b))/f
3.1.38.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(c*x)^( m + 1)*((a + b*x^2)^(p + 1)/(a*c*(m + 1))), x] - Simp[b*((m + 2*p + 3)/(a*c ^2*(m + 1))) Int[(c*x)^(m + 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, p }, x] && LtQ[m, -1] && IntBinomialQ[a, b, c, 2, m, p, x]
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_ )]^(m_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff^(m + 1)/f Subst[Int[x^m*(ExpandToSum[a + b*(1 + ff^2*x^2)^(n/2), x]^p/(1 + f f^2*x^2)^(m/2 + 1)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[m/2] && IntegerQ[n/2]
Time = 0.29 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.96
method | result | size |
derivativedivides | \(\frac {-\frac {1}{\left (a +b \right ) \tan \left (f x +e \right )}-\frac {b \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{\left (a +b \right ) \sqrt {\left (a +b \right ) b}}}{f}\) | \(52\) |
default | \(\frac {-\frac {1}{\left (a +b \right ) \tan \left (f x +e \right )}-\frac {b \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{\left (a +b \right ) \sqrt {\left (a +b \right ) b}}}{f}\) | \(52\) |
risch | \(-\frac {2 i}{f \left (a +b \right ) \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}-\frac {\sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}-a -2 b}{a}\right )}{2 \left (a +b \right )^{2} f}+\frac {\sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}+a +2 b}{a}\right )}{2 \left (a +b \right )^{2} f}\) | \(127\) |
Time = 0.30 (sec) , antiderivative size = 271, normalized size of antiderivative = 5.02 \[ \int \frac {\csc ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\left [\frac {\sqrt {-\frac {b}{a + b}} \log \left (\frac {{\left (a^{2} + 8 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 4 \, {\left ({\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{3} - {\left (a b + b^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt {-\frac {b}{a + b}} \sin \left (f x + e\right ) + b^{2}}{a^{2} \cos \left (f x + e\right )^{4} + 2 \, a b \cos \left (f x + e\right )^{2} + b^{2}}\right ) \sin \left (f x + e\right ) - 4 \, \cos \left (f x + e\right )}{4 \, {\left (a + b\right )} f \sin \left (f x + e\right )}, \frac {\sqrt {\frac {b}{a + b}} \arctan \left (\frac {{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - b\right )} \sqrt {\frac {b}{a + b}}}{2 \, b \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right )}{2 \, {\left (a + b\right )} f \sin \left (f x + e\right )}\right ] \]
[1/4*(sqrt(-b/(a + b))*log(((a^2 + 8*a*b + 8*b^2)*cos(f*x + e)^4 - 2*(3*a* b + 4*b^2)*cos(f*x + e)^2 + 4*((a^2 + 3*a*b + 2*b^2)*cos(f*x + e)^3 - (a*b + b^2)*cos(f*x + e))*sqrt(-b/(a + b))*sin(f*x + e) + b^2)/(a^2*cos(f*x + e)^4 + 2*a*b*cos(f*x + e)^2 + b^2))*sin(f*x + e) - 4*cos(f*x + e))/((a + b )*f*sin(f*x + e)), 1/2*(sqrt(b/(a + b))*arctan(1/2*((a + 2*b)*cos(f*x + e) ^2 - b)*sqrt(b/(a + b))/(b*cos(f*x + e)*sin(f*x + e)))*sin(f*x + e) - 2*co s(f*x + e))/((a + b)*f*sin(f*x + e))]
\[ \int \frac {\csc ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\int \frac {\csc ^{2}{\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \]
Time = 0.26 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.93 \[ \int \frac {\csc ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=-\frac {\frac {b \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} {\left (a + b\right )}} + \frac {1}{{\left (a + b\right )} \tan \left (f x + e\right )}}{f} \]
-(b*arctan(b*tan(f*x + e)/sqrt((a + b)*b))/(sqrt((a + b)*b)*(a + b)) + 1/( (a + b)*tan(f*x + e)))/f
Time = 0.29 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.31 \[ \int \frac {\csc ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=-\frac {\frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b + b^{2}}}\right )\right )} b}{\sqrt {a b + b^{2}} {\left (a + b\right )}} + \frac {1}{{\left (a + b\right )} \tan \left (f x + e\right )}}{f} \]
-((pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan(f*x + e)/sqrt(a*b + b^2)))*b/(sqrt(a*b + b^2)*(a + b)) + 1/((a + b)*tan(f*x + e)))/f
Time = 18.12 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.85 \[ \int \frac {\csc ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=-\frac {\mathrm {cot}\left (e+f\,x\right )}{f\,\left (a+b\right )}-\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {\sqrt {b}\,\mathrm {tan}\left (e+f\,x\right )}{\sqrt {a+b}}\right )}{f\,{\left (a+b\right )}^{3/2}} \]